package com.antexpress.dao;

import com.antexpress.pojo.Employee;
import com.antexpress.pojo.Title;
import java.util.List;

/**
 *
 * @author Andy
 */
public interface EmployeeDAO {
    /*通过username获取员工对象及部门、职位等信息*/
    Employee getEmployeeByUsername(String username);
    /*更新员工信息*/
    boolean updateEmployee(Employee emp);
    /**
        * 分页查询员工列表
        * @param offset 开始记录
        * @param length 要查询记录的数量
    **/
    List<Employee> listEmpForPage(String name, String mobile, Title title, int offset, int length);
    int getRowCountByTitle(String name, String mobile, Title title);
    List<Employee> listEmpForPageByTitles(String name,String mobile, List<Title> titles, int offset, int length);
    int getRowCountByTitles(String name,String mobile, List<Title> titles);
    /*获取员工表总记录数*/
    int getAllRowCount();
    boolean addEmployee(Employee emp);
    boolean isUsernameExisted(String username);
    boolean isEmailExisted(String email);
    boolean batchUpdateEmp(List<Employee> emps);
    Employee getEmployeeById(String id);
    List<Employee> getEmpsByTitle(Title title);
    List<Employee> getEmpsByTitles(List<Title> titles);
    int getInServiceEmpNum();
    int getLeavingEmpNum();
    List<Employee> getInServiceEmpsByTitle(Title title);
}
